/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.niedziela12.pai.ejb.reservation.endpoints;

import com.niedziela12.pai.ejb.dto.ReservationDTO;
import com.niedziela12.pai.ejb.reservation.managers.ReservationManagerLocal;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

/**
 *
 * @author Kamil
 */
@Stateless
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class ReservationEndpoint implements ReservationEndpointLocal {

    @EJB
    private ReservationManagerLocal reservationManager;

    @Override
    public void addNewReservation(ReservationDTO reservation) {
        reservationManager.addNewReservation(reservation);
    }

    @Override
    public void updateReservationInfo(ReservationDTO reservation) {
        reservationManager.updateReservationInfo(reservation);
    }

    @Override
    public void deleteReservation(ReservationDTO reservation) {
        reservationManager.deleteReservation(reservation);
    }

    @Override
    public List<ReservationDTO> getReservations(int from, int to) {
        return reservationManager.getReservations(from, to);
    }

    @Override
    public List<ReservationDTO> getAllReservations() {
        return reservationManager.getAllReservations();
    }

    @Override
    public int getReservationsCount() {
        return reservationManager.getReservationsCount();
    }

    @Override
    public ReservationDTO getReservation(Long id) {
        return reservationManager.getReservation(id);
    }

    @Override
    public List<ReservationDTO> getReservationForUser(String login) {
        return reservationManager.getReservationForUser(login);
    }
}
